package net.viralpatel.struts2;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class DeleteAction {
	private String ordercd;
	private List<Yoyaku> listYoyaku =new ArrayList<Yoyaku>();
	JDBCQuery jdbc;
	public String execute()
	{
		try {
			
						
			jdbc=new JDBCQuery();
			jdbc.deleteYoyaku(ordercd);	
			
			Map session = ActionContext.getContext().getSession();
			String username= session.get("username").toString();
			jdbc=new JDBCQuery();
			listYoyaku=jdbc.getYoyaku(username);
			
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return ActionSupport.SUCCESS;
	}
	public String getOrdercd() {
		return ordercd;
	}
	public void setOrdercd(String ordercd) {
		this.ordercd = ordercd;
	}
	public List<Yoyaku> getListYoyaku() {
		return listYoyaku;
	}
	public void setListYoyaku(List<Yoyaku> listYoyaku) {
		this.listYoyaku = listYoyaku;
	}
}
